<template>
    <div>
        <!--缩略图-->
        <vue-preview :slides="slide1"></vue-preview>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                slide1: [],
            }
        },
        created(){
           this.getPreviewImg();
        },

        methods:{
            //获取缩略图数据
            getPreviewImg:function(){
                this.$http.get('api/getthumimages/'+this.id).then( result=>{
                    if(result.body.status === 0){
                        result.body.message.forEach(obj =>{
                            obj.msrc = obj.src;
                            obj.w = 600;
                            obj.h = 400;                                                               
                        });
                        this.slide1 = result.body.message;
                    }else{
                        Toast({
                            message: '获取缩略图失败',
                            position: 'middle',
                            duration: 2000
                        });
                    }
                });
            }
        },

        props:['id'],
    }
</script>

<style lang="less" scoped>

</style>
